-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure wrapcallback is used #762
Make sure wrapcallback is used #762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @gabrielschulhof I assume the extra overhead of another call is not going to be significant as finalization is not too common?
@mhdawson it should be inlined. |
@gabrielschulhof I assume you mean by the compiler, if so that makes sense as I see you have it marked as inline |
@mhdawson, yeah, sorry, I meant by the compiler. |
I believe this is blocked by #773. |
fe30826
to
c1cdb39
Compare
Rebased on top of #773. I had to change the child process to examine the exception in the process' |
c1cdb39
to
db0af19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
New CI: |
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #762 Reviewed-By: Michael Dawson <[email protected]> test: add finalizer exception test src: wrap finalizer callback
Landed in cec2c76. |
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <[email protected]> test: add finalizer exception test src: wrap finalizer callback
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <[email protected]> test: add finalizer exception test src: wrap finalizer callback
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <[email protected]> test: add finalizer exception test src: wrap finalizer callback
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <[email protected]> test: add finalizer exception test src: wrap finalizer callback
Finalizers are also able to call JS code and therefore throw. Thus, when calling the user's finalizer, we should wrap it in our C++-to-JS-exception converter.